package com.gzbsoft.sc.modules.sys.entity;
import io.ebean.annotation.DbComment;
import io.ebean.annotation.DbDefault;
import io.ebean.annotation.DocEmbedded;
import io.ebean.annotation.DocStore;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.OneToOne;
import javax.persistence.Table;
@DocStore
@EqualsAndHashCode(callSuper = true)
@Data
@Entity
@Table(name = "jx_shop")
@DbComment("店铺表")
public class JxShop extends BaseEntity {
    @DocEmbedded(doc = "id,username")
    @OneToOne
    @Column(name = "user_id")
    private JxUser user;
    @DbComment("店铺名")
    private String name;
    @DbComment("描述")
    private String description;
    @DbComment("logo")
    private String logo;
    @DocEmbedded
    @DbComment("商家店铺模版")
    private JxShopTemplate shopTemplate;
    @DbComment("注册地址")
    private String address;
    @DbComment("交易量")
    @DbDefault("0")
    private String saleCount;
    @DbComment("信用等级")
    private Integer credit;
    @DbComment("店铺状态,0: 打烊.1: 正常")
    private Integer status;
    @DbComment("店铺类型, 1: 精英店, 2: 进阶店, 3: 旗舰店")
    private String type;
    @DbComment("经营模式:1:厂家自营,2:代理销售")
    private String businessModel;
    @DbComment("注册时间(精确到周)")
    private String registered;
    @DbComment("是否诚信店铺")
    private Boolean sincerity;
    @Override
    public String toString() {
        return "JxShop{" +
                "user=" + user +
                ", name='" + name + '\'' +
                ", description='" + description + '\'' +
                ", logo='" + logo + '\'' +
                ", shopTemplate=" + shopTemplate +
                ", address='" + address + '\'' +
                ", saleCount='" + saleCount + '\'' +
                ", credit=" + credit +
                ", status=" + status +
                ", type='" + type + '\'' +
                ", sincerity=" + sincerity +
                ", id=" + id +
                '}';
    }
}
